package com.compty.core.framework.plugin.payment.deposit;

import javax.servlet.http.HttpServletRequest;

import com.compty.core.framework.context.webcontext.ThreadContextHolder;
import com.compty.core.framework.plugin.AbstractPaymentPlugin;
import com.compty.core.framework.plugin.payment.IPaymentEvent;
import com.compty.paint.domain.Order;

/**
 * 预存款支付
 * @author kingapex
 * 2010-5-26下午02:29:09
 */
public class DepositPlugin extends AbstractPaymentPlugin implements IPaymentEvent{
	
	
	public String onCallBack() {
		HttpServletRequest request = ThreadContextHolder.getHttpRequest();
		String orderid = request.getParameter("orderid");
		
		try{
			this.paySuccess(Integer.valueOf(orderid));
		}catch(RuntimeException e){
			if(this.logger.isDebugEnabled()){
				this.logger.debug(e.getMessage(),e);
			}
			return e.getMessage();
		}
		
		return "支付成功";
	}

	
	public String getAuthor() {
		
		return "kingapex";
	}

	
	public String getId() {
		
		return "deposit";
	}

	
	public String getName() {
		
		return "预存款支付";
	}

	
	public String getType() {
		
		return "payment";
	}

	
	public String getVersion() {
		
		return "1.0";
	}

	
	public void perform(Object... params) {
		

	}
	
	public void register() {

	}


	public String onPay(Order order) {
		return null;
	}


	public String onPreStore(Double orderAmount) {
		return null;
	}

}
